{% extends "base_site.html" %}
{% load i18n %}

{% block content_title %}
<h2>{{content_title}}</h2>
{% endblock %}
{% block content %}
  <div id="content-main">
 {% if mygroups_desktop %}
    {% if form.is_multipart %}
      <form enctype="multipart/form-data" method="post" action="{{ user_action }}">{% csrf_token %}
    {% else %}
      <form action="{{ user_action }}" method="post">{% csrf_token %}
    {% endif %}
        <ul class="plainlist">
        {{ form.as_ul }}
        </ul>
        <div id="mygroups-div">
          <h4>{% trans 'New data will be added to the following groups:'%}</h4>
          {% for gr in mygroups_data %}
          <div>
            <div class="in-line-link"><a href="/admin/auth/group/{{ gr.0.group_id }}">{{ gr.0 }}</a></div>
            {% if gr.1 %}
            <div class="in-line"><input type="checkbox" checked="checked" id="grdata_{{ gr.0.group_id }}" name="data-in-groups-{{ gr.0.group_id }}" value="{{ gr.0.group_id }}" /></div>
            {% else %}
            <div class="in-line"><input type="checkbox" id="grdata_{{ gr.0.group_id }}" name="data-in-groups-{{ gr.0.group_id }}" value="{{ gr.0.group_id }}" /></div>
            {% endif %}
          </div>
          {% endfor %}
        </div>
        <div>
          <input type="submit" name="save" value="Submit" />
        {% if cancel %}
          <input type="submit" name="cancel" value="Cancel" />
        {% endif %}
        </div>
      </form>
  {% else %}
  <p>{% trans 'You cannot add data! There are no groups on desktop.'%}</p>
  {% endif %}
  </div>
{% endblock %}
